[C#] how do I get the height of a rich text content after word wrap?

Posted by Led on Stack Overflow See other posts from Stack Overflow or by Led
Published on 2010-05-07T02:03:25Z Indexed on 2010/05/07 2:08 UTC
Read the original article Hit count: 423

Filed under:
|

Question A. Given 1. A string in rich text format that may have paragraph, tabs, space, line break, indentation, (or even image?)
2. A width for the word wrapping rich text control/editor

How do I know the height of the content after it have performed all the word wrapping? Is there something like int MeasureRichTextHeightAfterWordWrap(string aRichTextContent, int aWidth)? Otherwise how does those rich text control know how much to autosize? Do I have to actually place the content on a dummy rich text control and get its height afterwards?

Question B. Similar to question A but in plain text onto a plain text memo/control/editor. And manually draw string with manually calculated indentations, breaks, word wrappings. Is it easier or harder?

© Stack Overflow or respective owner

Related posts about c#

Related posts about richtext